local Hurt = class("Hurt")

function Hurt:ctor(value, isCrit, element, canCounterattack, entity)
    self.value = math.floor(value)
    self.isCrit = isCrit
    self.element = element
    self.canCounterattack = canCounterattack
    self.isIgnoreSheild = false
    self.suckBlood = 0
    self:setEntity(entity)
end

function Hurt:setEntity(entity) -- 谁造成的伤害
    if entity then
        self.entityId = entity:getId()
    end
end

function Hurt:setResist(entity) -- 受伤的人帮他抵挡了伤害
    if entity then
        self.resistEntityId = entity:getId()
    end
end

function Hurt:setIgnoreSheild(ignore)
    self.isIgnoreSheild = ignore
end

function Hurt:setSuckBlood(value)
    self.suckBlood = value
end

function Hurt:setAbsorb(Absorb)
    self.absorb = Absorb
end

return Hurt
